import 'package:json_annotation/json_annotation.dart';
part 'specList.g.dart';

@JsonSerializable()
class SpecListResult {
  final bool success;
  final String message;
  final List<SpecInfo> data;

  const SpecListResult(
    this.success,
    this.message,
    this.data,
  );

  factory SpecListResult.fromJson(Map json) => _$SpecListResultFromJson(json);
  Map toJson() => _$SpecListResultToJson(this);
}

@JsonSerializable()
class SpecInfo {
  final int id;
  final String name;
  final String key;
  final String type;
  final String options;
  final String value;

  SpecInfo(
    this.id,
    this.name,
    this.key,
    this.type,
    this.options,
    this.value,
  );

  factory SpecInfo.fromJson(Map json) => _$SpecInfoFromJson(json);
  Map toJson() => _$SpecInfoToJson(this);
}
